#!/bin/bash
# 快速测试批量处理系统

echo "========================================="
echo "  批量处理系统快速测试"
echo "========================================="
echo ""

# 检查依赖
echo "1. 检查依赖..."
python3 -c "import openai" 2>/dev/null || {
    echo "  ❌ openai 未安装"
    echo "  安装: pip3 install --user openai"
    exit 1
}
python3 -c "import tqdm" 2>/dev/null || {
    echo "  ❌ tqdm 未安装"
    echo "  安装: pip3 install --user tqdm"
    exit 1
}
echo "  ✅ 所有依赖已安装"
echo ""

# 测试视频
TEST_VIDEO="/Volumes/Samsung_T5/数据爬取/B 站/关键词作品/狮子林/视频作品/BV13DGez8ETV苏州园林2-em class=keyword狮子林em 全网最详细游玩攻略.mp4"

if [ ! -f "$TEST_VIDEO" ]; then
    echo "❌ 测试视频不存在"
    echo "   请修改 quick_test.sh 中的 TEST_VIDEO 路径"
    exit 1
fi

echo "2. 测试视频: $(basename "$TEST_VIDEO")"
echo ""

# 选项1: 只转录不润色（快速测试）
echo "========================================="
echo "选项1: 只转录测试（无需API Key）"
echo "========================================="
read -p "是否执行？(y/n): " choice1
if [ "$choice1" = "y" ]; then
    python3 batch_process.py "$TEST_VIDEO" --skip-polish
    echo ""
    echo "结果查看: ls -lh batch_output/"
    ls -lh batch_output/
fi

echo ""
echo "========================================="
echo "选项2: 完整测试（转录+润色）"
echo "========================================="
echo "需要 DeepSeek API Key"
read -p "是否执行？(y/n): " choice2
if [ "$choice2" = "y" ]; then
    read -p "请输入 DeepSeek API Key: " api_key
    python3 batch_process.py "$TEST_VIDEO" --api-key "$api_key"
    echo ""
    echo "结果查看:"
    ls -lh batch_output/
    echo ""
    echo "对比润色效果:"
    echo "--- 原始转录 ---"
    head -5 batch_output/*_raw.txt
    echo ""
    echo "--- 润色后 ---"
    head -5 batch_output/*_polished.txt
fi

echo ""
echo "========================================="
echo "测试完成！"
echo "========================================="
echo ""
echo "下一步："
echo "1. 查看 BATCH_PROCESSING.md 了解详细用法"
echo "2. 修改 batch_process.py 中的 DEEPSEEK_API_KEY"
echo "3. 运行: python3 batch_process.py your_videos/*.mp4"
echo ""
